package com.admin.dbdao;

import com.admin.bean.FindInfor;
import com.data.dbdao.BaseDao;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Repository;

import javax.transaction.Transactional;
import java.util.List;

/**
 * 发现管理
 *
 * @author:HingLo
 * @create 2017-10-19 10:12
 **/
@Repository
@Transactional
public class FindAdminDao extends BaseDao {
    private static Logger logger = Logger.getLogger(FindAdminDao.class);

    /**
     * 将资设置为激活状态，就可以在客户端显示了
     *
     * @param id
     * @return
     */
    public boolean updateFindDao(String id, boolean state) {
        String hql = "update FindInfor set state=? where id=?";
        return super.updateOneMssageDao(hql, state, id);
    }

    /**
     * 删除发现内容
     *
     * @param id
     * @return
     */
    public boolean deleteFindDao(String id) {
        String hql = "delete FindInfor where id=?";
        return super.updateOneMssageDao(hql, id);
    }

    public List<FindInfor> inputFindlistDao() {
        String hql = "from FindInfor";
        return (List<FindInfor>) super.findMassageDao(hql);
    }


}
